class OpenApiToAllUsers < ActiveRecord::Migration
  def self.up
    User.all.each do |user|
      UserToolSetting::OpenApis.create!(
        :user_id => user.id,
        :tool_id => Tool.find_by_code('open_apis').id,
        :column => 2,
        :position => 100
      )
    end if not Rails.env.test?
  end

  def self.down
    UserToolSetting::OpenApis.delete_all
  end
end
